# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: Grigory Kirillov <txgk@bk.ru>
pkgname=bzip3
pkgver=1.1.4
pkgrel=0
pkgdesc="Better and stronger spiritual successor to BZip2"
url="https://github.com/kspalaiologos/bzip3"
arch="all"
license="LGPL-3.0-only"
# clang provides better performance https://gitlab.alpinelinux.org/alpine/aports/-/issues/13807
makedepends="clang"
subpackages="$pkgname-libs $pkgname-static $pkgname-dev"
source="https://github.com/kspalaiologos/bzip3/releases/download/$pkgver/bzip3-$pkgver.tar.gz"

build() {
	CC=clang ./configure \
		--target="$CTARGET" \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr
	make all
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

libs() {
	pkgdesc="$pkgdesc (library)"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libbzip3.so "$subpkgdir"/usr/lib/
}

sha512sums="
3d85932bbcc0690c52cc359fab19f3fb8295c1863ce2b753aedd9ab6a733c297214b5eef486402e20405b5ad02c2535032ca7f3ba72f765bdd05d392b0ee0e89  bzip3-1.1.4.tar.gz
"
